package com.example.shengyin.service;

import com.example.shengyin.dao.ShopMapper;
import com.example.shengyin.entity.Page;
import com.example.shengyin.entity.Shop;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopService {

    @Autowired
    private ShopMapper dao;

    // 根据id查找具体的门店
    public Shop selectShopById(@Param("id") Long id){
        return dao.selectShopById(id);
    }



   public List<Shop> select(Long id){
        return dao.select(id);
    }

    public List<Shop> list(Page page, String sname) {
       return dao.list((page.getPage()-1)*page.getLimit(),page.getLimit(),sname);
    }

    public int count(String sname)
    {
        return dao.count(sname);
    }



    public int insert(Shop dShop){
        return dao.insert(dShop);
    }
    public int update(Shop dShop){
        return dao.update(dShop);
    }
    public int delete(int id){
        return dao.delete(id);
    }
    public int deleteByIds(String ids){
        return dao.deleteByIds(ids);
    }
}
